import 'package:flutter_test/flutter_test.dart';
import 'package:thing_smart_sdk/thing_smart_sdk.dart';
import 'package:thing_smart_sdk/thing_smart_sdk_platform_interface.dart';
import 'package:thing_smart_sdk/thing_smart_sdk_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockThingSmartSdkPlatform
    with MockPlatformInterfaceMixin
    implements ThingSmartSdkPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<String?> configSDK() {
    // TODO: implement configSDK
    throw UnimplementedError();
  }

}

void main() {
  final ThingSmartSdkPlatform initialPlatform = ThingSmartSdkPlatform.instance;

  test('$MethodChannelThingSmartSdk is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelThingSmartSdk>());
  });

  test('getPlatformVersion', () async {
    ThingSmartSdk thingSmartSdkPlugin = ThingSmartSdk();
    MockThingSmartSdkPlatform fakePlatform = MockThingSmartSdkPlatform();
    ThingSmartSdkPlatform.instance = fakePlatform;

    expect(await thingSmartSdkPlugin.getPlatformVersion(), '42');
  });
}
